package clsaa;

import data.ConfigBigLotto;

import javax.swing.*;

//一个彩票号码的类
public class Biglotto {
    private int id;
    private String date;
    private int A;
    private int B;
    private int C;
    private int D;
    private int E;
    private int F;
    private int G;

    public Biglotto() {
    }

    public Biglotto(int id, String date, int a, int b, int c, int d, int e, int f, int g) {
        this.id = id;
        this.date = date;
        A = a;
        B = b;
        C = c;
        D = d;
        E = e;
        F = f;
        G = g;
    }
    public Biglotto(String id, String date, String a, String b, String c, String d, String e, String f, String g) {
        this.id = Integer.parseInt(id);
        this.date = date;
        this.A=Integer.parseInt(a);
        this.B=Integer.parseInt(b);
        this.C=Integer.parseInt(c);
        this.D=Integer.parseInt(d);
        this.E=Integer.parseInt(e);
        this.F=Integer.parseInt(f);
        this.G=Integer.parseInt(g);
    }
    public int duibi(int a,int b,int c,int d,int e,int f,int g){
        int numA=0;
        int numB=0;
        if(A==a ||B==a||C==a||D==a||E==a)++numA;
        if(A==b ||B==b||C==b||D==b||E==b)++numA;
        if(A==c ||B==c||C==c||D==c||E==c)++numA;
        if(A==d ||B==d||C==d||D==d||E==d)++numA;
        if(A==e ||B==e||C==e||D==e||E==e)++numA;
        if(F==f || G==f)++numB;
        if(F==g || G==g)++numB;
        if(numA==5 && numB==2){
            return 1;
        }else if(numA==5 && numB==2){
            return 2;
        }else if(numA==5 && numB==0){
            return 3;
        }else if(numA==4 && numB==2){
            return 4;
        }else if(numA==4 && numB==1){
            return 5;
        }else if(numA==3 && numB==2){
            return 6;
        }else if(numA==4 && numB==0){
            return 7;
        }else if(numA==3 && numB==1){
            return 8;
        }else if(numA==2 && numB==2){
            return 8;
        }else if(numA==3 && numB==0){
            return 9;
        }else if(numA==1 && numB==2){
            return 9;
        }else if(numA==2 && numB==1){
            return 9;
        }else if(numA==0 && numB==2){
            return 9;
        }
        return 0;
    }
    public int getId() {
        return id;
    }
    public String ThistoString(){
        return "第"+id+"期 时间："+date+"--> "+A+"  "+B+"  "+C+"  "+D+"  "+E+" + "+F+"  "+G+"  \n";
    }
    public void setId(int id) {
        this.id = id;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getA() {
        return A;
    }

    public void setA(int a) {
        A = a;
    }

    public int getB() {
        return B;
    }

    public void setB(int b) {
        B = b;
    }

    public int getC() {
        return C;
    }

    public void setC(int c) {
        C = c;
    }

    public int getD() {
        return D;
    }

    public void setD(int d) {
        D = d;
    }

    public int getE() {
        return E;
    }

    public void setE(int e) {
        E = e;
    }

    public int getF() {
        return F;
    }

    public void setF(int f) {
        F = f;
    }

    public int getG() {
        return G;
    }

    public void setG(int g) {
        G = g;
    }
}
